let arr = [1, 4, 7, 5, 7, 6, 4, 1]
let ccc = [1, 4, 7, 5, 7, 6, 4, 1, 66, 77, 66]
function deWeight1(value) {
    let arr = []
    value.forEach(item => {
        if (!arr.includes(item)) {
            arr.push(item)
        }
    });
    return arr
}
function deWeight2(value) {
    for (let index = 0; index < value.length; index++) {
        for (let j = index + 1; j < value.length; j++) {
            if (arr[index] === arr[j]) {
                arr.splice(j, 1)
                j--
            }
        }

    }
    return value
}
function deWeight3(value) {
    var arr = []
    for (let i = 0; i < value.length; i++) {
        if (arr.indexOf(value[i]) == -1) {
            arr.push(value[i])
        }
    }
    return arr
}
console.log(deWeight1(arr));
console.log(deWeight2(arr));
// console.log(deWeight2(ccc));
console.log(arr);
console.log(deWeight3(arr));